﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="PlanDeMarketingEdit.aspx.cs"
    Inherits="CrmContacto.WebApp.App.PlanDeMarketingEdit" %>

<%@ Import Namespace="Web.Framework.Translate" %>
<asp:Content ID="HeaderContent" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="/Scripts/App/PlanDeMarketingEdit.js" type="text/javascript"></script>
    <link href="/Styles/App/AccionDeMarketing.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
    $(function () {
        // a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
        $("#dialog:ui-dialog").dialog("destroy");

        $("#dialogmodalprocesando").dialog({
            height: 200,
            autoOpen: false,
            width: 'auto',
            modal: true,
            buttons: [{ text: "<asp:Literal ID="lit900" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.Command.Ok"]%>' />", click: function () { window.PlanDeMarketingEditObj.GoToNewComunicacion(); } },
                      { text: "<asp:Literal ID="lit901" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.Command.Cancelar"]%>' />", click: function () { $(this).dialog('close'); } }
                     ]
            
        });
    });      

    </script>

    <h2>
        <asp:Literal ID="lit1" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.EditTitle"]%>' />
        <img width="15px" height="15px" id="imgExpand" class="imgExpand" src="/Images/icon_blockexpanded.png"
            onclick="window.AppCommonObj.toggleVisibility(this.id, 'planDeMarketingEditDiv');"
            alt="" />
        <span class="clear"></span>
    </h2>
    <div id="tabs" class="marketingTabs">
        <ul>
            <li><a href="#planDeMarketingEditDiv">
                <asp:Literal ID="Literal4" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.PlanMarketingEdit.Tab.Edicion"]%>' /></a></li>
            <li><a href="#planDeMarketingEstadisticas">
                <asp:Literal ID="Literal6" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.PlanMarketingEdit.Tab.Estadisticas"]%>' /></a></li>
        </ul>
        <div id="customerDataDiv">
            <div class="clear">
            </div>
            <div class="editionContainerFilter" id="planDeMarketingEditDiv">
                <div class="clear">
                </div>
                <div class="divLeft">
                <p>
                    <span class="title2">
                        <asp:Literal ID="Literal10" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["PlanDeMarketing.Nombre"]%>' />:</span>
                    <asp:TextBox ID="txtNombre" runat="server" CssClass="inputs inputlong" ClientIDMode="Static"
                        title='<%$ Code:  LocalizationProvider.Instance["PlanDeMarketing.Nombre"] %>'></asp:TextBox>
                </p>
                <div class="clear">
                </div>
                <p>
                    <span class="title2">
                        <asp:Literal ID="Literal2" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["PlanDeMarketing.Descripcion"]%>' />:</span>
                    <asp:TextBox ID="txtDescripcion" runat="server" CssClass="inputs inputMultiline"
                        ClientIDMode="Static" TextMode="MultiLine" ></asp:TextBox>
                </p>
                <div class="clear">
                </div>
                 <p>
                    <span class="title2">
                        <asp:Literal ID="Literal23" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["PlanDeMarketing.Responsable"]%>' />:</span>
                    <asp:TextBox ID="txtResposable" runat="server" CssClass="inputs inputlong" ClientIDMode="Static"
                        title='<%$ Code:  LocalizationProvider.Instance["PlanDeMarketing.Responsable"] %>'></asp:TextBox>
                </p>
                <div class="clear">
                </div>
                <div class="divp">
                    <span class="title2">
                        <asp:Literal ID="Literal9" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["PlanDeMarketing.Estado"]%>' />:</span>
                   <%-- <asp:DropDownList ID="cboEstado" runat="server" CssClass="cbo readonly" ClientIDMode="Static"
                        Enabled="false">
                    </asp:DropDownList>--%>
                    <asp:Label ID="lblEstado" runat="server" Text=""></asp:Label>
                </div>
                <div class="clear">
                </div>
                <div class="divp">
                    <span class="title2">
                        <asp:Literal ID="Literal3" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["PlanDeMarketing.VigenciaDesde"]%>' />:</span>
                    <asp:TextBox ID="txtVigenciaDesde" runat="server" CssClass="inputs" ClientIDMode="Static"></asp:TextBox>
                </div>
                <div class="clear">
                </div>
                <div class="divp">
                    <span class="title2">
                        <asp:Literal ID="Literal5" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["PlanDeMarketing.VigenciaHasta"]%>' />:</span>
                    <asp:TextBox ID="txtVigenciaHasta" runat="server" CssClass="inputs" ClientIDMode="Static"></asp:TextBox>
                </div>
                <div class="clear">
                </div>
                </div>
                <div id="marketingEditDiv2" class="divLeft2">
                 <fieldset class="fieldsetInDiv">
                        <legend>
                            <asp:Literal ID="Literal8" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Edit.ValoresEsperados"]%>' /></legend>
                        <div>
                            <p>
                                <span class="title2">
                                    <asp:Literal ID="Literal7" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Datos.InversionInicial"]%>' />:</span>
                                <asp:TextBox ID="txtInversionInicial" runat="server" CssClass="inputs numberRight" ClientIDMode="Static"
                                    title='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Datos.InversionInicial"] %>'></asp:TextBox>
                            </p>
                            <div class="clear">
                            </div>
                            <p>
                                <span class="title2">
                                    <asp:Literal ID="Literal13" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Datos.ROIDinero"]%>' />:</span>
                                <asp:TextBox ID="txtROIDinero" runat="server" CssClass="inputs numberRight" ClientIDMode="Static"
                                    title='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Datos.ROIDinero"] %>'></asp:TextBox>
                            </p>
                            <div class="clear">
                            </div>
                            <p>
                                <span class="title2">
                                    <asp:Literal ID="Literal14" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Datos.ROIPorcentaje"]%>' />:</span>
                                <asp:TextBox ID="txtROIPorcentaje" runat="server" CssClass="inputs numberRight" ClientIDMode="Static"
                                    title='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Datos.ROIPorcentaje"] %>'></asp:TextBox>
                            </p>
                            <div class="clear">
                            </div>
                            <p>
                                <span class="title2">
                                    <asp:Literal ID="Literal15" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Datos.EficaciaEsperada"]%>' />:</span>
                                <asp:TextBox ID="txtEficaciaEsperada" runat="server" CssClass="inputs numberRight" ClientIDMode="Static"
                                    title='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Datos.EficaciaEsperada"] %>'></asp:TextBox>
                            </p>
                            <div class="clear">
                            </div>
                        </div>
                    </fieldset>
                 <div class="clear">
                </div>
                </div>
                <div class="clear">
                </div>
            </div>
            <div class="editionContainerFilter" id="planDeMarketingEstadisticas">
                <span class="subtitle"><asp:Literal ID="Literal11" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Edit.ValoresObtenidos"]%>' /></span>
                <br />
                <br />
                <div>
                    <p>
                        <span class="title2">
                            <asp:Literal ID="Literal12" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Estadistica.InversionTotal"]%>' />:</span>
                        <asp:TextBox ID="txtInversionTotal" runat="server" CssClass="inputs numberRight"
                            ClientIDMode="Static" title='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Estadistica.InversionTotal"] %>'></asp:TextBox>
                    </p>
                    <div class="clear">
                    </div>
                    <p>
                        <span class="title2">
                            <asp:Literal ID="Literal16" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Estadistica.CantidadUsuariosUnicos"]%>' />:</span>
                        <asp:TextBox ID="txtCantidadUsuariosUnicos" runat="server" CssClass="inputs numberRight"
                            ClientIDMode="Static" title='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Estadistica.CantidadUsuariosUnicos"] %>'></asp:TextBox>
                    </p>
                    <div class="clear">
                    </div>
                    <p>
                        <span class="title2">
                            <asp:Literal ID="Literal17" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Estadistica.TicketPromedio"]%>' />:</span>
                        <asp:TextBox ID="txtTicketPromedio" runat="server" CssClass="inputs numberRight"
                            ClientIDMode="Static" title='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Estadistica.TicketPromedio"] %>'></asp:TextBox>
                    </p>
                    <div class="clear">
                    </div>
                    <p>
                        <span class="title2">
                            <asp:Literal ID="Literal18" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Estadistica.Eficiencia"]%>' />:</span>
                        <asp:TextBox ID="txtEficiencia" runat="server" CssClass="inputs numberRight" ClientIDMode="Static"
                            title='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Estadistica.Eficiencia"] %>'></asp:TextBox>
                    </p>
                    <div class="clear">
                    </div>
                    <p>
                        <span class="title2">
                            <asp:Literal ID="Literal19" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Estadistica.ROIDinero"]%>' />:</span>
                        <asp:TextBox ID="txtROIDineroEst" runat="server" CssClass="inputs numberRight" ClientIDMode="Static"
                            title='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Estadistica.ROIDinero"] %>'></asp:TextBox>
                    </p>
                    <div class="clear">
                    </div>
                    <p>
                        <span class="title2">
                            <asp:Literal ID="Literal20" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Estadistica.ROIPorcentaje"]%>' />:</span>
                        <asp:TextBox ID="txtROIPorcentajeEst" runat="server" CssClass="inputs numberRight"
                            ClientIDMode="Static" title='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.Estadistica.ROIPorcentaje"] %>'></asp:TextBox>
                    </p>
                    <div class="clear">
                    </div>
                </div>
                <div class="clear">
                </div>
            </div>
        </div>
       
    </div>
     <div class="commandBarDiv">
         <asp:LinkButton ID="lnkGuardar" runat="server" CssClass="guardar" 
                ClientIDMode="Static"><asp:Literal ID="Literal21" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.Command.Guardar"]%>' /></asp:LinkButton>           
            <div class="clear">
            </div>
        </div>
    <br />
    <asp:Panel ID="pnlWrapAccionesDeMarketing" runat="server" ClientIDMode="Static">
    <div>
        <h2 class="h2Excel">
            <asp:Literal ID="Literal1" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.PlanDeMarketing.AccionesDeMarketing"]%>' />
            <img width="15px" height="15px" id="img1" class="imgExpand" src="/Images/icon_blockexpanded.png"
                onclick="window.AppCommonObj.toggleVisibility(this.id, 'pnlAccionesDeMarketing');"
                alt="" />
            <span class="clear"></span>
        </h2>
        <div class="divExportarAExcelGrid">
                <asp:LinkButton ID="lnkExportarAExcel" CssClass="promolnkExportarAExcel" ClientIDMode="Static"
                    OnClick="lnkExportarAExcel_Click" runat="server">
                    <img style="text-decoration: none; border: 0px; margin-right: 4px" src="../Images/excel.png"
                        alt="" /><asp:Literal ID="Literal24" runat="server" Text='<%$ Code: LocalizationProvider.Instance["Bo.SearchContacto.CmdExportarExcel"]%>' /></asp:LinkButton>
            </div>
            <div class="clear">
            </div>
        </div>
        <asp:Panel ID="pnlAccionesDeMarketing" CssClass="editionContainerForGrid" runat="server"
            ClientIDMode="Static">
            <div class="clear">
            </div>
            <asp:GridView ID="GridAccionesDeMarketing" runat="server" CellPadding="4" ForeColor="#333333"
                ViewStateMode="Enabled" GridLines="None" AutoGenerateColumns="False" DataKeyNames="Id"
                Width="100%" AllowPaging="True" PageSize="15" OnPageIndexChanging="GridAccionesDeMarketing_PageIndexChanging"
                OnRowCommand="GridAccionesDeMarketing_RowCommand" OnRowDataBound="GridAccionesDeMarketing_RowDataBound">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:TemplateField HeaderText="">
                        <HeaderStyle HorizontalAlign="Left" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:ImageButton ID="btnEditar" runat="server" ImageUrl="~/Images/editar.png"
                                CommandName="editar" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" />
                        </ItemTemplate>
                    </asp:TemplateField>   
                    <asp:TemplateField HeaderText="">
                        <HeaderStyle HorizontalAlign="Left" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:ImageButton ID="btnEliminar" runat="server" ImageUrl="~/Images/eliminar.png"
                                CommandName="eliminar" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Nombre" HeaderText='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.Nombre"] %>'>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="CodigoParaPDV" HeaderText='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.Codigo"] %>'>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="FechaDesde" HeaderText='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.FechaEventoDesde"] %>'
                        DataFormatString="{0:dd/MM/yyyy}">
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="FechaHasta" HeaderText='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.FechaEventoHasta"] %>'
                        DataFormatString="{0:dd/MM/yyyy}">
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Discriminador" HeaderText='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.Discriminador"] %>'>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                     <asp:BoundField DataField="Estado" SortExpression="Estado" HeaderText='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.Estado"] %>'>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#4b6c9e" Font-Bold="True" ForeColor="White" HorizontalAlign="Left"
                    CssClass="gridSortingHeader" />
                <PagerStyle BackColor="#4b6c9e" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" CssClass="gridSortingHeader" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" CssClass="gridSortingHeader" />
            </asp:GridView>
        </asp:Panel>
    </asp:Panel>
    <div class="clear">
    </div>
     <div id="dialogmodalprocesando" style="text-align: left;vertical-align: middle" title="<asp:Literal ID="lit903" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.AccionMarketing.Comunicacion.TituloTipo"]%>' />" >
                  <span style="text-align: left"><asp:Literal ID="Literal22" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.TipoDeComunicacion"]%>' />:</span>
                    <br />        
                  <asp:DropDownList ID="cboTipoAccionComunicacion" runat="server" ClientIDMode="Static" Width="300" >
                    </asp:DropDownList>
                     <div class="clear">
    </div>
    </div>
    <script type='text/javascript'>

        $(document).ready(function () {

            if (!window.AppCommonObj) {
                window.AppCommonObj = new AppCommon();
            }

            if (!window.CrmCommonObj) {
                window.CrmCommonObj = new CrmCommon();
            }

            if (!window.PlanDeMarketingEditObj) {
                window.PlanDeMarketingEditObj = new PlanDeMarketingEdit();
            }

            $('#txtVigenciaDesde').datepick({ dateFormat: 'dd/mm/yyyy' });
            $('#txtVigenciaHasta').datepick({ dateFormat: 'dd/mm/yyyy' });

            $('input[title],textarea[title]').inputHints();

            document.DirtyCheck = new DirtyCheck();
            document.DirtyCheck.loadControlState();

           AppCommonObj.ConfirmMovePage();              

            $("#tabs").tabs(); //{ selected: < %= (int)currentTab % >, disabled: < %=disabledTabs % > });

        });
    </script>
</asp:Content>
